﻿Imports System.Data

Public Class SearchLookupEdit_GetIndexByKeyValue
    Private Sub SearchLookupEdit_GetIndexByKeyValue_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        'load dữ liệu
        Me.KhachhangTableAdapter.Fill(Me.PcvgppDataSet.khachhang)
        Me.ThuchitietTableAdapter.Fill(Me.PcvgppDataSet.thuchitiet)

    End Sub

    Private Sub RepositoryItemSearchLookUpEdit1_CloseUp(sender As Object, e As DevExpress.XtraEditors.Controls.CloseUpEventArgs) Handles RepositoryItemSearchLookUpEdit1.CloseUp
        'Try
        '    Dim rowHandle As Integer = RepositoryItemSearchLookUpEdit1.GetIndexByKeyValue(e.Value)
        '    Dim dr As DataRow = Me.PcvgppDataSet.khachhang.Rows(rowHandle)
        '    If Not IsNothing(dr) Then
        '        'gán cột 'ten' trên searchlookupedit vô cột taikhoanco trong gridview1
        '        GridView1.SetRowCellValue(GridView1.FocusedRowHandle, "taikhoanco", dr("ten"))
        '        'GridView1.SetRowCellValue(GridView1.FocusedRowHandle, "sochungtu", dr("loai"))
        '        'GridView1.SetRowCellValue(GridView1.FocusedRowHandle, "Description", dr("Description"))
        '        e.AcceptValue = True
        '    Else
        '        e.AcceptValue = False
        '    End If
        'Catch ex As Exception
        '    e.AcceptValue = False
        'End Try

    End Sub

    Private Sub RepositoryItemSearchLookUpEdit1_EditValueChanged(sender As Object, e As System.EventArgs) Handles RepositoryItemSearchLookUpEdit1.EditValueChanged

    End Sub
End Class